<template>
  <div class="app-wrapper">
    <MyHeader class="app-header"/>
    <div class="content-wp">
      <div class="content-left"></div>
      <div class="content-main">
        <router-view></router-view>
      </div>
      <div class="content-right"></div>
    </div>
    <div class="app-footer" v-if="$route.meta.showFooter"></div>
  </div>
</template>

<script>
import { mapState } from "vuex";
import MyHeader from "./components/header";

export default {
  name: "Layout",
  components: {
    MyHeader,
  },
  computed: {
    ...mapState({
      // theme: state => state.settings.theme,
      // sideTheme: state => state.settings.sideTheme,
      // sidebar: state => state.app.sidebar,
      // device: state => state.app.device,
      // needTagsView: state => state.settings.tagsView,
      // fixedHeader: state => state.settings.fixedHeader
    }),
  },
  methods: {},
};
</script>

<style lang="scss" scoped>
.app-wrapper {
  min-width: 1200px;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  background-image: url("~@/assets/images/home/dot.svg");
  background-size: 16px;

  .content-wp {
    flex: 1;
    display: flex;
    min-height: 0;
    max-height: calc(100% - 70px);
    overflow-y: auto;
    position: relative;

    .content-main {
      flex: 1;
    }

    .content-left,
    .content-right {
      width: 22px;
      height: calc(100% - 60px);
      background-repeat: no-repeat;
      margin-top: 60px;
      background-position: 0 0;
      background-size: auto calc(100% - 100px);
      position: sticky;
      top: 60px;
    }

    .content-left {
      margin-left: 18px;
      background-image: url("~@/assets/images/layout/content-left.png");
    }

    .content-right {
      margin-right: 18px;
      background-image: url("~@/assets/images/layout/content-right.png");
    }
  }

  .app-footer {
    width: 100%;
    height: 41px;
    background-image: url("~@/assets/images/layout/footer.png");
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: left bottom;
  }
}
</style>
